<?php

class Pipes_FileSystem_File
{
    private $_fullPath = null;
    public function __construct($file) 
    {
        $this->_fullPath = realpath($file);
        $this->_file = $file;
    }
    
    public function exists()
    {
        return file_exists($this->_fullPath);
    }
    
    public function requireOnce()
    {
        if (!$this->exists()) {
            throw new Pipes_Exception("unknown file [{$this->_file}]");
        }
        
        require_once $this->_fullPath;
    }

    public function __get($key) {
        if ($key == 'fullPath') {
            return $this->_fullPath;
        }
    }
}
